import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * User: Alex
 * Date: 13.06.13
 * Time: 11:07
 * To change this template use File | Settings | File Templates.
 */
public class Rabbit extends Animal {
    private int STEPS = 1;
    Rabbit(int widthSpace, int lengthSpace) {
        super(widthSpace, lengthSpace);
    }

    public void move() {
        System.out.println("Rabbit.move()");
        while (!(setDirection(randomDirection(), STEPS)));
    }

    public Directions randomDirection() {
        int rand = new Random().nextInt(6);
        if (rand == 0) {
            return Directions.UP;
        } else if (rand == 1) {
            return Directions.DOWN;
        } else if (rand == 2) {
            return Directions.LEFT;
        } else if (rand == 3) {
            return Directions.RIGHT;
        } else if (rand == 4) {
            return Directions.UPRIGHT;
        } else if (rand == 5) {
            return Directions.DOWNLEFT;
        } else return Directions.DEFAULT;
    }
}
